package com.ztesoft.book.api.controller.sys;

import com.ztesoft.book.common.utils.Result;
import com.ztesoft.book.common.utils.mail.MailUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Description 邮件发送
 * @Author YangFan
 * @Date 2021-07-15 14:42
 */
@Slf4j
@RestController
@RequestMapping("/sys/sysMail")
public class SysMailController {


    @Resource
    private MailUtils mailUtils;


    /**
     * 方法功能描述:
     * < 发送带附件邮件 >
     *
     * @param title   参数说明
     * @param target  参数说明
     * @param content 参数说明
     * @param path    参数说明
     * @return Result
     * @author YangFan
     * @date 2021-07-25 15:48
     */
    @PostMapping("/sendAttachFileMail")
    public Result sendAttachFileMail(String title, String target, String content, String path) {
        mailUtils.sendAttachFileMail(title, target, content, path);
        return Result.success("发送成功");
    }


}



